<?php
namespace Fyfyu\Admin\Controllers;

use Hyperf\Di\Annotation\Inject;
use Fyfyu\Admin\Annotations\AdminController;
use Fyfyu\Admin\Controller;
use Fyfyu\Admin\Models\Permission;
/**
 * @AdminController(prefix="permission")
 */
class PermissionController extends Controller{

    /**
     * @Inject()
     * @var Permission
     */
    protected $model;

    protected $title = '权限';

    protected function grid(){
        $this->grid->model()->where('id','>',1);
        $this->grid->column('name');
        $this->grid->column('display_name');
        $this->grid->url('地址');
        $this->grid->methods('请求方式');
        $this->grid->created_at('创建时间');
    }

    protected function form(){
        $this->form->text('username');
        $this->form->password('password','密码');
        $this->form->image('avatar')->width(100)->upload('http://www.baidu.com');
        $this->form->timestamps();
    }

}
